﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminmain.master" AutoEventWireup="true" CodeFile="addAdmin.aspx.cs" Inherits="admin_addAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script src="../js/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#<%=txtAddAdmin.ClientID %>").blur(function () {
            var username = $(this).val();
            $.post("../IsExistOrNot.ashx", { "name": username }, function (data) {
                if (data == "yes") {
                    $("#isornot").html('<font color="red">用户已存在！</font>');
                } else {
                    $("#isornot").html("");
                };
            });
        });
    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <br />
    <table>
    <tr>
    <td align="right">
    用户名：</td>
    <td>
    <asp:TextBox ID="txtAddAdmin" runat="server" BorderStyle="solid" BorderWidth="1px" BorderColor="#CBCBCB"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="不能为空" ForeColor="Red" ControlToValidate="txtAddAdmin"></asp:RequiredFieldValidator>
    <span id="isornot"></span>
    </td>
    <tr>
    <td align="right">
    密码：</td>
    <td>
    <asp:TextBox ID="txtAddPwd" runat="server" ControlToValidate="txtAddPwd" BorderStyle="solid" BorderWidth="1px" BorderColor="#CBCBCB"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ErrorMessage="不能为空" ForeColor="Red" ControlToValidate="txtAddPwd" 
            Display="Dynamic"></asp:RequiredFieldValidator>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                  ControlToValidate="txtAddPwd" ErrorMessage="密码格式不对" ForeColor="Red" 
                  ValidationExpression="^[\@A-Za-z0-9\!\#\$\%\^\&amp;\*\.\~]{6,22}$" 
                  Display="Dynamic"></asp:RegularExpressionValidator>
    6-22位
    </td></tr>
    <tr><td colspan="2" align="center">
    <asp:LinkButton ID="lBtnAddAdmin" ForeColor="Red" runat="server" 
        onclick="lBtnAddAdmin_Click">添加管理员</asp:LinkButton>
    </td>
    </tr>
    </table>
    </asp:Content>

